<?php

namespace App\weapp\controller;

use App\model\CustomerModel;
use support\Request;

class CustomerController
{
    public function getListGroupLetter(){
        // 获取客户列表
        $cumtomers = CustomerModel::select(['id', 'avatar_url', 'name', 'phone', 'letter','last_sign_date','balance','points', 'is_star'])->orderBy('name')->get();
        return success('顾客列表',$cumtomers);
    }

    public function setAvatar(Request $request)
    {
        $data = $request->only(['id', 'avatar_url']);
        $data['update_by'] = $request->uid;
        CustomerModel::update($data);
        return success("更新成功");
    }
}
